<!DOCTYPE html>
<html>
<#include "../../common/header.ftl">
<script src="${basePath}/js/admin/list.js?v=201711021700"></script>

<head>
<meta charset="UTF-8">
<title>后台用户管理</title>
<style>
	.left{
		float:left;
		min-width:100px;
		margin-left: 10px;
	}
	.table-margin{
		margin:5px 3%;
		width:92%;
	}
</style>

</head>
<body>
   
<div class="container" style="margin-left:5%;width:90%">
	<form class="layui-form left" action="#" >
		<div class="layui-form-item ">
		    <div class="layui-input-block left">
		      <input type="text" name="keyword" value="${param.keyword!}"   placeholder="昵称/账号/角色"  
		      class="layui-input" style="width:400px;margin-right:200px;margin-left:30px">
		    </div>
		     <div class="layui-input-block left">
		      <button type="button" class="layui-btn"  id="search-button">搜索</button>
		      <#if permission?? && (permission.P203??)>
		      	<button type="button" class="layui-btn"  id="add-button">新增用户</button>
		      </#if>
		    </div>
		</div>
	</form>
</div>
<table class="table table-margin">
  <thead>
      <tr>
         <th>账号</th>
         <th>姓名</th>
         <th>手机号</th>
         <th>邮箱</th>
         <th>账号状态</th>
         <th>角色</th>
         <th>修改时间</th>
         <th>修改人</th>
         <th>最后登录时间</th>
         <th>操作</th>
      </tr>
  </thead>
  <tbody>
	<#list page.itemList! as admin>
		<tr>
			<td>${admin.accountName!}</td>
			<td>${admin.realName!}</td>
			<td>${admin.phone!}</td>
			<td>${admin.email!}</td>
			<td><#if admin.isEnabled?? && admin.isEnabled==1>启用
				<#else>禁用
				</#if>
			</td>
			<td>${admin.roleNames!}</td>
			<td>${admin.eatablishTime!}</td>
			<td>${admin.eatablishUser!}</td>
			<td>${admin.lastLoginTime!}</td>
			<td >
			<div class="btn-group ">
			  <button type="button" class="btn btn-primary dropdown-toggle " data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
			    	操作<span class="caret"></span>
			  </button>
			  <ul class="dropdown-menu">
			  	<#if permission?? && (permission.P204??)>
			    <li><a href="#" onclick="editFun('${admin.adminId}')">修改</a></li>
			    </#if>
			    <#if permission?? && (permission.P206??)>
			    <li><a href="#" onclick="deleteFun('${admin.adminId}')">删除</a></li>
			    </#if>
			    <#if permission?? && (permission.P207??)>
				    <#if admin.isEnabled?? && admin.isEnabled==1 >
				    	<li><a href="#" onclick="updateStatus('${admin.adminId}','0')">禁用</a></li>
				    <#else>
				    	<li><a href="#" onclick="updateStatus('${admin.adminId}','1')">启用</a></li>
				    </#if>
				</#if>
			  </ul>
			</div>
			</td>
		</tr>
	</#list>
  </tbody>
</table>
	<#-- 翻页模块代码 -->
	<ul class="pager">
		<li><a href="#" onclick="fanye('1')">首页</a></li>
		<#if (page.pageNo>1) > 
		<li><a	href="#" onclick="fanye('${page.prevPage}')">上一页</a></li>
		<#else>
		<li><a>上一页</a></li> 
		</#if>
		<li><a href="#">第${page.pageNo}页/共${page.totalPage}页</a></li>
		<#if (page.nextPage>page.pageNo) >
		<li><a href="#" onclick="fanye('${page.nextPage}')">下一页</a></li>
		<#else>
		<li><a>下一页</a></li>
		</#if>
		<li><a href="#" onclick="fanye('${page.totalPage}')">尾页</a></li>
	</ul>
  
</body>
<script type="text/javascript">
	var basePath="${basePath}";
	var init={
		keyword:"${param.keyword!}"
	}
	$(function(){
		layui.use(['form', 'layer'] , function(){
		  var layer = layui.layer;
		  var form = layui.form(); 
	});
});
</script>
</html>